<% @results.each do |hotel| %>
    <% unless hotel["name"].blank? %> 
       <article>
            <header>
                <h2><a href="<%= hotel["business_uri"] %>"><%= hotel["name"] %></a></h2>
                <figure> <%= image_tag hotel["photo_primary"] %> <!-- <figcaption><%#= index %></figcaption> --></figure>
                <p><span class="rating-a <%= hotel_star(hotel["star_rating"]) %>">0/5</span><%= hotel["name"] %> - <%= hotel["province_name"] %>, <%= hotel["regional"] %> </p>
            </header>
            <%#= raw(truncate( hotel.description_eng , :length => 150 ))  %>
            <p class="scheme-d" style="font-size:2em"><span>Rp.</span><%= hotel["price"].to_s %> 
                <%#= link_to "book", {controller: "hotel_ticket", action: "hotel_ticket_detail", url: hotel["business_uri"].gsub("https://api.master18.tiket.com/", '')}, style: "font-size:0.6em;" %>
                <% l = hotel["business_uri"].split('?').first %>
                <% u = URI.parse(hotel["business_uri"].to_s) %>
                <% p = CGI.parse(u.query) %>
                <%= link_to "book",{controller: "hotel_ticket", action: "hotel_ticket_detail", name: l.split('hotel').last ,startdate: p["startdate"].first, enddate: p["enddate"].first, night: p["night"].first, room: p["room"].first, adult: p["adult"].first, child: p["child"].first, uid: p["uid"].first} , style: "font-size:0.6em;" %>
             </p>
            <footer>
                <p>User Rating <span class="rating-b <%= user_rating(hotel["rating"].to_s) %>">0/5</span></p>
             <!--    <p class="link-b"><a href="./">View Details</a></p> -->
            </footer>
        </article>
    <% end %>
<% end %>